Interpret ESC in operator popup
authorjustbur <justin@burkett.cc>
Sat, 30 Jan 2016 01:41:15 +0000 (20:41 -0500)
committerjustbur <justin@burkett.cc>
Sat, 30 Jan 2016 01:41:15 +0000 (20:41 -0500)
See #99

which-key.el

index 3b8927d05c255b52d75ec96fc2d2de3113b2e2ec..37370764f4a7535d9f6a9f24357930151fae9506 100644 (file)
@@ -1947,8 +1947,12 @@ is selected interactively by mode in `minor-mode-map-alist'."
     (let* ((key (key-description (list (read-key)))))
       (cond ((and which-key-use-C-h-commands (string= "C-h" key))
              (which-key-C-h-dispatch))
-            (t (setq unread-command-events (listify-key-sequence key))
-               (which-key--hide-popup))))))
+            ((string= key "ESC")
+             (which-key--hide-popup)
+             (keyboard-quit))
+            (t
+             (which-key--hide-popup)
+             (setq unread-command-events (listify-key-sequence key)))))))
 
 (defun which-key--create-buffer-and-show (&optional prefix-keys)
   "Fill `which-key--buffer' with key descriptions and reformat.